﻿using System;
using Mono.Cecil.Metadata;

namespace Mono.Cecil
{
	// Token: 0x020000A5 RID: 165
	public sealed class OptionalModifierType : TypeSpecification, IModifierType
	{
		// Token: 0x17000192 RID: 402
		// (get) Token: 0x06000684 RID: 1668 RVA: 0x000214A4 File Offset: 0x0001F6A4
		// (set) Token: 0x06000685 RID: 1669 RVA: 0x00004644 File Offset: 0x00002844
		public TypeReference ModifierType
		{
			get
			{
				return this.modifier_type;
			}
			set
			{
				this.modifier_type = value;
			}
		}

		// Token: 0x17000193 RID: 403
		// (get) Token: 0x06000686 RID: 1670 RVA: 0x000214BC File Offset: 0x0001F6BC
		public override string Name
		{
			get
			{
				return base.Name + this.Suffix;
			}
		}

		// Token: 0x17000194 RID: 404
		// (get) Token: 0x06000687 RID: 1671 RVA: 0x000214E0 File Offset: 0x0001F6E0
		public override string FullName
		{
			get
			{
				return base.FullName + this.Suffix;
			}
		}

		// Token: 0x17000195 RID: 405
		// (get) Token: 0x06000688 RID: 1672 RVA: 0x00021504 File Offset: 0x0001F704
		private string Suffix
		{
			get
			{
				string str = " modopt(";
				TypeReference typeReference = this.modifier_type;
				return str + ((typeReference != null) ? typeReference.ToString() : null) + ")";
			}
		}

		// Token: 0x17000196 RID: 406
		// (get) Token: 0x06000689 RID: 1673 RVA: 0x00009C40 File Offset: 0x00007E40
		// (set) Token: 0x0600068A RID: 1674 RVA: 0x00002AA0 File Offset: 0x00000CA0
		public override bool IsValueType
		{
			get
			{
				return false;
			}
			set
			{
				throw new InvalidOperationException();
			}
		}

		// Token: 0x17000197 RID: 407
		// (get) Token: 0x0600068B RID: 1675 RVA: 0x0000A3A0 File Offset: 0x000085A0
		public override bool IsOptionalModifier
		{
			get
			{
				return true;
			}
		}

		// Token: 0x17000198 RID: 408
		// (get) Token: 0x0600068C RID: 1676 RVA: 0x00021538 File Offset: 0x0001F738
		public override bool ContainsGenericParameter
		{
			get
			{
				return this.modifier_type.ContainsGenericParameter || base.ContainsGenericParameter;
			}
		}

		// Token: 0x0600068D RID: 1677 RVA: 0x00021560 File Offset: 0x0001F760
		public OptionalModifierType(TypeReference modifierType, TypeReference type) : base(type)
		{
			bool flag = modifierType == null;
			if (flag)
			{
				throw new ArgumentNullException(Mixin.Argument.modifierType.ToString());
			}
			Mixin.CheckType(type);
			this.modifier_type = modifierType;
			this.etype = Mono.Cecil.Metadata.ElementType.CModOpt;
		}

		// Token: 0x040001DB RID: 475
		private TypeReference modifier_type;
	}
}
